package models;

import javax.persistence.Entity;

import models.deadbolt.Role;
import play.data.validation.Required;
import play.db.jpa.Model;

@Entity
public class ADietaRol extends Model implements Role {
	
	private static final long serialVersionUID = -7785400821530692675L;
	
	@Required
	public String name;
	
	public ADietaRol(String name) {
		this.name = name;
	}
	
	@Override
	public String getRoleName() {
		return name;
	}
	
	public static ADietaRol getByName(String name) {
		return ADietaRol.find("byName", name).first();
	}
	
	@Override
	public String toString() {
		return this.name;
	}
	
}
